package com.piz.model;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotEmpty;


@Entity
@Table(name = "user_contact")
public class UserContact implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6678400979409915072L;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "CONTACT_ID", unique = true, nullable = false)
	private Long id;
	
	@Column(name = "DESIGNATION")
	private String designation;
	
	@Column(name = "CMP_NAME")
	private String companyName;
	
	@NotEmpty
	@Column(name = "CMP_ADDR1")
	private String cmpaddress1;
	
	@Column(name = "CMP_ADDR2")
	private String cmpaddress2;
	
	@NotEmpty
	@Column(name="STATE")
	private String state;
	
	@NotNull(message = "may not be Empty")
	@Column(name="CITY")
	private Long city;

	@Column(name = "ZIP")
	@NotEmpty
	private String zip;
	
	@Column(name = "MOBILE")
	private String phoneMobile;
	
	@Column(name = "PH_LANDLINE")
	private String phoneLandline;
	
	@Column(name = "EMAIL_ID")
	@NotEmpty
	@Pattern(regexp = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$", message="Enter Valid Email Id")
	private String emailId;
	

	/**
	 * 
	 */
	public UserContact() {
		// TODO Auto-generated constructor stub
	}

	
	/**
	 * @param designation
	 * @param companyName
	 * @param cmpaddress1
	 * @param cmpaddress2
	 * @param state
	 * @param city
	 * @param zip
	 * @param phoneMobile
	 * @param phoneLandline
	 * @param emailId
	 */
	public UserContact(String designation, String companyName,
			String cmpaddress1, String cmpaddress2, String state, Long city,
			String zip, String phoneMobile, String phoneLandline, String emailId) {
		this.designation = designation;
		this.companyName = companyName;
		this.cmpaddress1 = cmpaddress1;
		this.cmpaddress2 = cmpaddress2;
		this.state = state;
		this.city = city;
		this.zip = zip;
		this.phoneMobile = phoneMobile;
		this.phoneLandline = phoneLandline;
		this.emailId = emailId;
	}


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDesignation() {
		return designation;
	}

	public void setDesignation(String designation) {
		this.designation = designation;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCmpaddress1() {
		return cmpaddress1;
	}

	public void setCmpaddress1(String cmpaddress1) {
		this.cmpaddress1 = cmpaddress1;
	}

	public String getCmpaddress2() {
		return cmpaddress2;
	}

	public void setCmpaddress2(String cmpaddress2) {
		this.cmpaddress2 = cmpaddress2;
	}

	
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	
	public Long getCity() {
		return city;
	}

	public void setCity(Long city) {
		this.city = city;
	}

	public String getZip() {
		return zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	public String getPhoneMobile() {
		return phoneMobile;
	}

	public void setPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
	}

	public String getPhoneLandline() {
		return phoneLandline;
	}

	public void setPhoneLandline(String phoneLandline) {
		this.phoneLandline = phoneLandline;
	}

	public String getEmailId() {
		return emailId;
	}

	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}

	
}
